<template>
    <div class="home">
        <div class="examination">
            <img class="examination-ic" src="@/assets/images/home-examination-ic.png" />
            <div class="examination-title">体测考试</div>
            <img class="daily-line" src="@/assets/images/home-line.png" />
            <div class="examination-content" @click="goRouter(1)">
                <div class="examination-content-name">体测项目考试</div>
                <div class="examination-content-text">规范测成绩，评估<br />体能水平</div>
            </div>
        </div>
        <div class="daily">
            <img class="daily-ic" src="@/assets/images/home-daily-ic.png" />
            <div class="daily-title">日常练习</div>
            <img class="daily-line" src="@/assets/images/home-line.png" />
            <div class="daily-content" @click="goRouter(2)">
                <div class="daily-content-name">体测项目练习</div>
                <div class="daily-content-text">针对性训练，提升体测<br />
                    能力，练出好成绩</div>
            </div>
        </div>

    </div>
</template>

<script setup name="Home">
import { ref, computed, onMounted, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import  useUserStore  from '@/store/modules/user'
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const route = useRoute();
const router = useRouter();

//1 体测项目考试 2体测项目练习
function goRouter(index) {
     userStore.setHomeActive(index)
    if (index == 1) {
        router.push({ path: '/examination', })
    } else {
        router.push({ path: '/project', })
    }
   
}
</script>

<style scoped lang="scss">
.home {
    width: 100%;
    height: 100%;
    background: url("@/assets/images/home-bg.png") no-repeat;
    background-size: 100% 100%;
    display: flex;
    padding: 170px 140px 0 140px;
    box-sizing: border-box;
    justify-content: space-between;
    overflow: hidden;
}
.examination {
    margin-top: 50px;
    background: url("@/assets/images/home-examination-bg.png") no-repeat;
    background-size: 100% 100%;
    width: 748px;
    height: 725px;
    position: relative;
    &-line {
        position: absolute;
        left: 80px;
        top: 94px;
        width: 643px;
        height: 10px;
        opacity: 1;
    }
    &-content {
        background: url("@/assets/images/home-examination-content.png")
            no-repeat;
        background-size: 100% 100%;
        position: absolute;
        left: 35px;
        top: 146px;
        width: 678px;
        height: 546px;
        z-index: 1;
        cursor: pointer;
        &:hover {
            border-radius: 24px;
            border: 2px solid #ffffff;
            box-shadow: inset 0px 0px 20px 0px #ffffff;
        }
        &-name {
            font-size: 48px;
            line-height: 58px;
            position: absolute;
            left: 58px;
            top: 54px;
            color: #ffffff;
            opacity: 0.8;
        }

        &-text {
            font-size: 40px;
            line-height: 58px;
            position: absolute;
            left: 58px;
            top: 130px;
            color: #ffffff;
            opacity: 0.6;
        }
    }
    &-ic {
        width: 114px;
        height: 124px;
        position: relative;
        left: -40px;
    }
    &-title {
        position: absolute;
        left: 120px;
        top: 37px;
        font-family: YouSheBiaoTiHei;
        font-size: 56px;
        line-height: 51px;
        color: #54fee7;
    }
}

.daily {
    margin-top: 50px;
    background: url("@/assets/images/home-daily-bg.png") no-repeat;
    background-size: 100% 100%;
    width: 748px;
    height: 725px;
    background: url("@/assets/images/home-daily-bg.png") no-repeat;
    background-size: 100% 100%;
    width: 748px;
    height: 725px;
    position: relative;
    &-line {
        position: absolute;
        left: 80px;
        top: 94px;
        width: 643px;
        height: 10px;
        opacity: 1;
    }
    &-content {
        background: url("@/assets/images/home-daily-content.png") no-repeat;
        background-size: 100% 100%;
        position: absolute;
        left: 35px;
        top: 146px;
        width: 678px;
        height: 546px;
        z-index: 1;
        cursor: pointer;
        &:hover {
            border-radius: 24px;
            border: 2px solid #ffffff;
            box-shadow: inset 0px 0px 20px 0px #ffffff;
        }
        &-name {
            font-size: 48px;
            line-height: 58px;
            position: absolute;
            left: 58px;
            top: 54px;
            color: #ffffff;
            opacity: 0.8;
        }

        &-text {
            font-size: 40px;
            line-height: 58px;
            position: absolute;
            left: 58px;
            top: 130px;
            color: #ffffff;
            opacity: 0.6;
        }
    }
    &-ic {
        width: 114px;
        height: 124px;
        position: relative;
        left: -40px;
    }
    &-title {
        position: absolute;
        left: 120px;
        top: 37px;
        font-family: YouSheBiaoTiHei;
        font-size: 56px;
        line-height: 51px;
        color: #8ad0f6;
    }
}
</style>

